function res_ll = compute_wc_LL(I)
% Compute log-linearized solution for the wealth-consumption ratio

% Set Options
options_fmincon = optimoptions('fmincon','Algorithm','sqp', 'MaxFunEvals', 100000,'MaxIter',200,'Display','iter','FinDiffType','central');

% Solve system of equations for mean wealth-consumption ratio
mean_wc_init = 5;
[mean_wc,~,Exitflag] = fmincon(@(x) 1,mean_wc_init,[],[],[],[],[],[],@(x) wrap_vec(mean_wc_LL(x,I)),options_fmincon);

if Exitflag == 1
else
    error('Log-Linearization did not converge')
end

% Compute linearization parameters 
[~, res_ll.kappa_0, res_ll.kappa_1, res_ll.A_0, res_ll.A_1] = mean_wc_LL(mean_wc,I);

end